define(function (require, exports, module) {
    var sTpl = require("./index.html");
    var _ = require("third/lodash.js");

    var vueComponent = Vue.extend({
        template: sTpl,
        data: function () {
            return {
                userId: '',
                userData: {
                    name: '',
                    sex: '',
                    age: ''
                }
            }
        },
        created: function () {
            this.userId = parseInt(this.$route.params.userId) || 0;
            alert(this.userId);
            var list = [{
                id: 1001,
                name: '王孟贵',
                sex: '男',
                age: 29
            }, {
                id: 1002,
                name: '李小华',
                sex: '男',
                age: 29
            }, {
                id: 1003,
                name: '隔壁老王',
                sex: '男',
                age: 29
            }, {
                id: 1004,
                name: '老王',
                sex: '男',
                age: 29
            }];

            var cur = _.find(list, { 'id': this.userId });
            if (cur != null) {
                this.userData = cur;
            }

        },
        methods: {

        }
    });


    Vue.component('m-update', vueComponent); //都全局注册 同时exports

    module.exports = vueComponent;
});